<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/common/common.jspf"%>
<style type="text/css">
.col-sm-3 {
	width: 15%;
	float: left;
	text-align: right;
}

.col-sm-9 {
	width: 85%;
	float: left;
	text-align: left;
}

label[class^="btn btn-default"] {
	margin-top: -4px;
}
</style>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post" action="${ctx}/meeting/editEntity.shtml">
		<section class="panel panel-default">
		<div class="panel-body">
			<div class="form-group">
				<div class="col-sm-3">
					<label class="control-label">会议名</label>
				</div>
				<div class="col-sm-9">
					<input type="hidden" name="meetingFormMap.id" value="${meeting.id}">
					<input type="text" class="form-control" placeholder="请输入会议名" name="meetingFormMap.name" value="${meeting.name}">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-3">
					<label class="control-label">会议描述</label>
				</div>
				<div class="col-sm-9">
					<textarea rows="4" name="meetingFormMap.content" style="width: 100%">${meeting.content}</textarea>
				</div>
			</div>
		</div>
		<footer class="panel-footer text-right bg-light lter">
		<button type="submit" class="btn btn-success btn-s-xs">提交</button>
		</footer> </section>
	</form>
	<script type="text/javascript">
	onloadurl();
	</script>
	<script type="text/javascript" src="${ctx}/notebook/notebook_files/bootstrap-filestyle.min.js"></script>
</body>

<script type="text/javascript">
$(function() {
	// 异步加载所有菜单列表
	$("form").validate({
		submitHandler : function(form) {// 必须写在验证前面，否则无法ajax提交
			ly.ajaxSubmit(form,{//验证新增是否成功
				type : "post",
				dataType : "json",
				success : function(data) {
					if (data == "success") {
						layer.confirm('修改成功!是否关闭窗口?', function(index) {
							parent.grid.loadData();
				        	parent.layer.close(parent.pageii);
				        	return false;
						});
					} else {
						layer.alert('修改失败！'+ data, 3);
					}
				}
			});
		},
		rules : {
			"meetingFormMap.name" : {
				required : true,
			},
			"meetingFormMap.content" : {
				required : true
			}
		},
		messages : {
			"meetingFormMap.name" : {
				required : "会议名不能为空"
			},
			"meetingFormMap.content" : {
				required : "分组描述不能为空"
			}
		},
		errorPlacement : function(error, element) {// 自定义提示错误位置
			$(".l_err").css('display', 'block');
			$(".l_err").html(error.html());
		},
		success : function(label) {// 验证通过后
			$(".l_err").css('display', 'none');
		}
	});
});
</script>
</html>